package com.zjitc.dao;

import com.zjitc.domain.Stu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StuMapper {
    @Select("select * from stu.t_stu")
    public List<Stu> selectAll();

    @Select("select * from stu.t_stu where id=#{id}")
    public Stu getStudentById(int id);

    @Update("update stu.t_stu set name=#{name},age=#{age} where id=#{id}")
    public int updateStu(Stu stu);

    @Delete("delete from stu.t_stu where id=#{id}")
    public int delete(int id);

    @Insert("insert into stu.t_stu( name, age) values (#{name},#{age})")
    public int insert(Stu stu);

    public List<Stu> findByCondition(Stu stu);
}
